package Synchronized;

public class TestProduct {
    public static void main(String[] args) {
        Shop shop = new Shop();//共享资源

    }
}
class Goods{
private  int id;
public Goods(int id){
    this.id=id;
}
}
class Shop{
    Goods goods;
    boolean flag;//表示商品是否充足
    //生产者调用 存的方法
    public void saveGoods(Goods goods){

    }
    //消费者调用取的方法
    public void buyGoods(){

    }
}
//生产者
class Product implements  Runnable{
Shop shop;
public  Product(Shop shop){
    this.shop=shop;
}
    @Override
    public void run() {

    }
}
//消费者
class Customer implements  Runnable{
    Shop shop;//商场
    public Customer (Shop shop){
        this.shop=shop;
    }
    @Override
    public void run() {

    }
}